package com.etime.shycourse.controller;

import com.etime.shy.common.BaseMessage;
import com.etime.shycourse.controller.wx.rss.WXRSSService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "access_token获取的数据接口")
@RestController
@RequestMapping("/accesstoken")
public class AccessTokenController {

    @Autowired
    private WXRSSService wxrssService;

    @ApiOperation("获取access_token")
    @GetMapping("/get")
    public BaseMessage getaccesstoken(){
        String accesstoken = wxrssService.getAccessToken();
        BaseMessage msg = new BaseMessage();
        msg.setCode(1);
        msg.setMsg(accesstoken);
        return msg;
    }
}
